﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MentorBackEnd.Model;

namespace WebApplication1.Account
{
    public partial class Profile : MentorMap.Web.MentorMapEditablePage
    {
        //MemaUser ActiveUser { get; set; }
        //MemaUser DisplayUser { get; set; }

        //protected override void OnInit(EventArgs e)
        //{
        //    base.OnInit(e);

        //    ActiveUser = MentorBackEnd.DA.UserDA.SelectUser(Convert.ToInt32(this.User.Identity.Name)).First();

        //    string id = Request.QueryString["id"];
        //    if (String.IsNullOrEmpty(id))
        //        id = this.User.Identity.Name;

        //    DisplayUser = MentorBackEnd.DA.UserDA.SelectUser(Convert.ToInt32(id)).First();
        //    AllowEdits = DisplayUser.MeMaUserID.Equals(ActiveUser.MeMaUserID);


        //    firstName.TextUpdated += new MentorMap.Web.TextUpdated(firstName_TextUpdated);
        //    lastName.TextUpdated += new MentorMap.Web.TextUpdated(lastName_TextUpdated);
        //    email.TextUpdated += new MentorMap.Web.TextUpdated(email_TextUpdated);

        //}

        //void email_TextUpdated(string text)
        //{
        //    ActiveUser.Email = text;
        //    //TODO: save
        //}

        //void lastName_TextUpdated(string text)
        //{
        //    ActiveUser.LastName = text;
        //    //TODO: save
        //}

        //void firstName_TextUpdated(string text)
        //{
        //    ActiveUser.FirstName = text;
        //    //TODO: save
        //}

        //protected override void OnLoad(EventArgs e)
        //{
        //    base.OnLoad(e);

        //    if (IsPostBack) return;

        //    firstName.Text = DisplayUser.FirstName;
        //    lastName.Text = DisplayUser.LastName;
        //    email.Text = DisplayUser.Email;
        //}
    }
}